﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DotNet.Business;

public partial class admin_adminProductClass : System.Web.UI.Page
{
    #region 初始化常量    
    tab_productClassBll productClassBll = new tab_productClassBll();
    #endregion
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["action"]!=null)
            {
                string action = Request.QueryString["action"];
                switch (action.Trim())
                {
                    case"del":
                        del();
                        break;
                    default:
                        break;
                }
            }
        }
        bindProductClass();
    }
    #region 删除
    public void del() 
    {
        int productClassID = Convert.ToInt32(Request.QueryString["productClassID"]);
        if (!productClassBll.Delete(productClassID))
        {
            Response.Write("1");
            Response.End();
        }
    }
    #endregion

    #region 绑定数据
    /// <summary>
    /// 绑定数据
    /// </summary>        
    public void bindProductClass() 
    {
        this.rep_productClass.DataSource = productClassBll.GetModel();
        this.rep_productClass.DataBind();
    }
    #endregion
}
